﻿using Nop.Core;
using Nop.Core.Domain.Customers;
using System.Collections.Generic;

namespace Spotshub.Plugin.Payments.GlobalPayments
{
    public class PaymentCreditCard : BaseEntity
    {
        private ICollection<PaymentTransaction> _transactions;

        /// <summary>
        /// Gets or sets the customer identifier
        /// </summary>
        public virtual int CustomerId { get; set; }

        /// <summary>
        /// Gets or sets the profile identifier
        /// </summary>
        public virtual int PaymentProfileId { get; set; }

        /// <summary>
        /// Gets or sets a credit card type (Visa, Master Card, etc...)
        /// </summary>
        public virtual string CreditCardType { get; set; }

        /// <summary>
        /// Gets or sets a credit card owner name
        /// </summary>
        public virtual string CreditCardName { get; set; }

        /// <summary>
        /// Gets or sets a credit card number
        /// </summary>
        public virtual string CreditCardNumber { get; set; }

        /// <summary>
        /// Gets or sets a credit card expire year
        /// </summary>
        public virtual int CreditCardExpireYear { get; set; }

        /// <summary>
        /// Gets or sets a credit card expire month
        /// </summary>
        public virtual int CreditCardExpireMonth { get; set; }

        /// <summary>
        /// Gets or sets the card token to authorize the transaction using the stored card.
        /// </summary>
        public virtual string Token { get; set; }

        /// <summary>
        /// Gets or sets the card comments.
        /// </summary>
        public virtual string Comment { get; set; }

        /// <summary>
        /// Gets or sets the RawResult
        /// </summary>
        public virtual string RawResult { set; get; }

        /// <summary>
        /// Gets or sets if the card is default
        /// </summary>
        public bool IsDefault { get; set; }

        /// <summary>
        /// Gets or sets the GT profile
        /// </summary>
        public virtual PaymentProfile PaymentProfile { get; set; }

        /// <summary>
        /// Gets or sets the transactions
        /// </summary>
        public virtual ICollection<PaymentTransaction> Transactions
        {
            get { return _transactions ?? (_transactions = new List<PaymentTransaction>()); }
            set { _transactions = value; }
        }
    }
}
